package com.tianquan.miracle.listener.refreshed;

import com.tianquan.miracle.listener.core.EventObject;

/**
 * @Author: tianquan
 * @date: 2024-10-12  17:34
 * @Description: 容器刷新完后事件
 */
public class ContextRefreshedEvent extends EventObject {

    /**
     * 容器开始启动时间
     */
    private long startTime;

    /**
     * 容器启动完成时间
     */
    private final long endTime;

    public ContextRefreshedEvent(Object source) {
        super(source);
        this.endTime = System.currentTimeMillis();
    }

    public ContextRefreshedEvent(Object source, long startTime) {
        super(source);
        this.startTime = startTime;
        this.endTime = System.currentTimeMillis();
    }

    public long getStartTime() {
        return startTime;
    }

    public long getEndTime() {
        return endTime;
    }

}
